<?php
namespace app\admin\controller;
use app\admin\common\Base;
use think\Db;

class CaseSite extends Base
{
	public function index () {
		$list = Db::table(array('case','case_class'))
			->where("case.case_class=case_class.id")
        	->field('case.id as id, case.case_class as case_class, case_class.name as case_class_name,case.title as title,case.desc as desci,case.views as views')
        	->order('id desc')->paginate(14);
		$total = $list->total();
        $page = $list->render();
        $this -> view -> assign('total', $total);
        $this -> view -> assign('list', $list);
        $this -> view -> assign('page', $page);
		return $this ->fetch('caseSite/case_list');
	}
}
